/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import com.google.common.collect.ImmutableList;
/*     */ import java.util.ArrayList;
/*     */ import java.util.HashMap;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import java.util.stream.Collectors;
/*     */ import net.minecraft.util.math.AxisAlignedBB;
/*     */ import net.minecraft.util.math.BlockPos;
/*     */ import net.minecraft.util.math.Vec3i;
/*     */ import org.yaml.snakeyamla.configuration.InvalidConfigurationException;
/*     */ import org.yaml.snakeyamla.configuration.file.YamlConfiguration;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class ex
/*     */ {
/*     */   public String i;
/*     */   private List<Vec3i> w;
/*     */   public AxisAlignedBB q;
/*     */   
/*     */   public ex(List<Vec3i> list) {
/*  36 */     this.w = list;
/*     */   }
/*     */   
/*     */   public String v() {
/*  40 */     return null;
/*     */   }
/*     */   
/*  43 */   private static Map<String, ex> g = new HashMap<>();
/*     */   
/*     */   public static ex v(String a) {
/*  46 */     if (a == null) return null;
/*     */     
/*  48 */     if (a.contains("item:")) {
/*  49 */       a = a.substring(0, a.indexOf("item:"));
/*     */     }
/*  51 */     if (!g.containsKey(a)) {
/*     */       
/*  53 */       YamlConfiguration yamlConfiguration = new YamlConfiguration(); try {
/*     */         ImmutableList<String> immutableList;
/*  55 */         yamlConfiguration.loadFromString(a);
/*     */         
/*  57 */         int i = 0;
/*  58 */         int j = 0;
/*     */         
/*  60 */         List<List> list = new ArrayList();
/*  61 */         List<?> list1 = new ArrayList();
/*  62 */         List list2 = yamlConfiguration.getStringList("structural");
/*     */         
/*  64 */         if (list2.isEmpty()) {
/*  65 */           immutableList = ImmutableList.of("o");
/*     */         }
/*  67 */         for (int k = 0; k < immutableList.size(); k++) {
/*  68 */           String str = immutableList.get(k);
/*     */           
/*  70 */           int n = str.indexOf("o");
/*  71 */           if (n >= 0) {
/*  72 */             i = n;
/*  73 */             j = k;
/*     */           } 
/*  75 */           if (str.contains("=")) {
/*  76 */             list.add(new ArrayList(list1));
/*  77 */             list1.clear();
/*     */           } else {
/*  79 */             list1.add(str);
/*     */           } 
/*     */         } 
/*  82 */         list.add(new ArrayList(list1));
/*  83 */         List<Vec3i> list3 = new ArrayList();
/*     */         
/*  85 */         for (int m = 0; m < list.size(); m++) {
/*  86 */           List<String> list4 = list.get(m);
/*     */           
/*  88 */           for (int n = 0; n < list4.size(); n++) {
/*  89 */             String[] arrayOfString = ((String)list4.get(n)).split("");
/*  90 */             for (int i1 = 0; i1 < arrayOfString.length; i1++) {
/*  91 */               if (!arrayOfString[i1].equals("x")) {
/*  92 */                 list3.add(new Vec3i(i1 - i, m, n - j));
/*     */               }
/*     */             } 
/*     */           } 
/*     */         } 
/*  97 */         ex ex2 = new ex(list3);
/*  98 */         ex2.i = yamlConfiguration.getString("model");
/*  99 */         ex2
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */           
/* 105 */           .q = new AxisAlignedBB(yamlConfiguration.getDouble("x1", 0.0D), yamlConfiguration.getDouble("y1", 0.0D), yamlConfiguration.getDouble("z1", 0.0D), yamlConfiguration.getDouble("x2", 1.0D), yamlConfiguration.getDouble("y2", 1.0D), yamlConfiguration.getDouble("z2", 1.0D));
/*     */         
/* 107 */         g.put(a, ex2);
/* 108 */       } catch (InvalidConfigurationException invalidConfigurationException) {
/* 109 */         g.put(a, null);
/*     */       } 
/*     */     } 
/* 112 */     ex ex1 = g.get(a);
/* 113 */     if (ex1 != null);
/*     */ 
/*     */     
/* 116 */     return ex1;
/*     */   }
/*     */   
/*     */   public List<BlockPos> v(BlockPos blockPos, float f) {
/* 120 */     if (f == 0.0F)
/* 121 */       return (List<BlockPos>)this.w.stream().map(vec3i -> new BlockPos(a.func_177958_n() + -vec3i.func_177958_n(), a.func_177956_o() + vec3i.func_177956_o(), a.func_177952_p() + -vec3i.func_177952_p()))
/*     */ 
/*     */ 
/*     */         
/* 125 */         .collect(Collectors.toList()); 
/* 126 */     if (f == 90.0F)
/* 127 */       return (List<BlockPos>)this.w.stream().map(vec3i -> new BlockPos(a.func_177958_n() + vec3i.func_177952_p(), a.func_177956_o() + vec3i.func_177956_o(), a.func_177952_p() + -vec3i.func_177958_n()))
/*     */ 
/*     */ 
/*     */         
/* 131 */         .collect(Collectors.toList()); 
/* 132 */     if (f == 180.0F)
/* 133 */       return (List<BlockPos>)this.w.stream().map(vec3i -> new BlockPos(a.func_177958_n() + vec3i.func_177958_n(), a.func_177956_o() + vec3i.func_177956_o(), a.func_177952_p() + vec3i.func_177952_p()))
/*     */ 
/*     */ 
/*     */         
/* 137 */         .collect(Collectors.toList()); 
/* 138 */     if (f == 270.0F) {
/* 139 */       return (List<BlockPos>)this.w.stream().map(vec3i -> new BlockPos(a.func_177958_n() + -vec3i.func_177952_p(), a.func_177956_o() + vec3i.func_177956_o(), a.func_177952_p() + vec3i.func_177958_n()))
/*     */ 
/*     */ 
/*     */         
/* 143 */         .collect(Collectors.toList());
/*     */     }
/*     */     
/* 146 */     return (List<BlockPos>)ImmutableList.of(blockPos);
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\ex.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */